<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.enterprise.domain.Page"%>
<%@page import="com.enterprise.domain.Recruit"%>
<%@page import="com.enterprise.daoImpl.RecruitDaoImpl"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="Inc/Head.jsp"%>

<script language=javascript>
function ConfirmDel()
{
   if(confirm("确定要删除此记录吗？"))
     return true;
   else
     return false;
}
</script>

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <br> <br> <table width="560" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
        <tr> 
          <td height="25" class="back_southidc"> 
            <div align="center"><strong>招 聘 管 理 <br>
              </strong></div></td>
        </tr>
        <tr> 
          <td><div align="center"> 
              <table width="100%" border="0" cellspacing="1" cellpadding="0">
                <tr bgcolor="#ECF5FF"> 
                  <td width="8%" height="25"> <div align="center">ID</div></td>
                  <td width="25%"> <div align="center">招聘对象</div></td>
                  <td width="11%"> <div align="center">招聘人数</div></td>
                  <td width="11%"> <div align="center">发布时间</div></td>
                  <td width="11%"> <div align="center">地点</div></td>
                  <td width="11%"> <div align="center">有效期限</div></td>
                  <td colspan="2"> <div align="center"></div>
                    <div align="center">操　作</div></td>
                </tr>
                <%
                	RecruitDaoImpl recruitDaoImpl=new RecruitDaoImpl();
                	List<Recruit> recruits=recruitDaoImpl.getAll();
                	int i=1,t;//默认当前页面为1
                	if(request.getParameter("pageNo")!=null)
                		i=Integer.parseInt(request.getParameter("pageNo"));
                	Page page2=new Page(10,recruits.size(),i);
                	i=page2.getCurrentPage();
     				if(recruits!=null&&recruits.size()>0)
                    for(t=page2.getFromIndex();t<page2.getToIndex();t++){
                    		Recruit recruit=recruits.get(t);
                
                 %>
                <tr bgcolor="#ECF5FF"> 
                  <td height="22"> <div align="center"><%=recruit.getId() %></div></td>
                  <td bgcolor="#ECF5FF">&nbsp;&nbsp;<%=recruit.getJob() %></td>
                  <td> <div align="center"><%=recruit.getCounts() %>人</div></td>
                  <td> <div align="center"><%=new SimpleDateFormat("yyyy-MM-dd").format(recruit.getPublisherTime())%></div></td>
                  <td> <div align="center"><%=recruit.getAddress() %></div></td>
                  <td> <div align="center"><%=recruit.getValidity() %>天</div></td>
                  <td width="11%"> <div align="center"><a href="Admin_HrDemandModify.jsp?job=<%=recruit.getJob()%>">修改</a></div></td>
                  <td width="13%"> <div align="center"><a href="recruit-delete.action?id=<%=recruit.getId() %>" onClick="return ConfirmDel();">删除</a></div></td>
                </tr>
                <%} %>
                               
                <tr bgcolor="#A4B6D7">
                	  <center>
      
      	<form name="showpages" method="Post" action="<%=basePath %>admin/Admin_HrDemand.jsp">
      		<table align="center" width="80%"  border="0" cellpadding="0" cellspacing="0">
      		<tbody>
    
      			<tr><td align="center">共 <b><%=recruits.size() %></b> 条记录&nbsp;&nbsp;<a href="<%=basePath %>admin/Admin_HrDemand.jsp?pageNo=1">首页</a><a href="<%=basePath %>admin/Admin_HrDemand.jsp?pageNo=<%=i-1%>"> 上一页</a>&nbsp;<a href="<%=basePath %>admin/Admin_HrDemand.jsp?pageNo=<%=i+1%>">下一页<a href="FeedbackView.jsp?pageNo=<%=page2.getPageCount()%>">&nbsp;尾页</a> &nbsp;页次：<strong><font color="red"><%=i %></font>/<%=page2.getPageCount() %></strong>页 &nbsp;<b>10</b>条记录/页&nbsp;转到：
      			<select name="pageNo" size="1" onchange="javascript:submit()">
      			<%
      				int j;
      				for(j=1;j<=page2.getPageCount();j++){ %>
      				<option value="<%=j%>" <%if(j==i){%> <%{%>selected='selected'<%}}%>>第<%=j%>页</option>
      				<%}%>
      			</select></td></tr></tbody></table>
      	</form>
      		
      			</center>
                
                 
                 </tr>
</table>

            </div></td>
        </tr>
      </table>
      <br> <br> </td>
  </tr>
</table>



<%@ include file="Inc/Foot.jsp"%>